#include <iostream>
#include <stdio.h>
#include <math.h>
using namespace std;
class Point

{

public:

	Point(int xx, int yy);

	Point(Point& r);

	int GetX();

	int GetY();

	~Point();

private:

	int x, y;

};
Point::Point(Point& r)
{
	cout << "Point's copyConstructor was called" << endl;
	x = r.x;
	y = r.y;
}
Point::Point(int xx, int yy)
{
	x = xx;
	y = yy;
	cout<< "Point's constructor was called"<<endl;
}
int Point::GetX()
{
	return x;
}
int Point::GetY()
{
	return y;
}
class Distance

{

private:

	Point p1, p2;

	double dist;

public:

	Distance(Point a, Point b);

	double GetDis();

	~Distance();

};
Distance::Distance(Point a, Point b)
	:p1(a),p2(b)
{
	dist = sqrt((a.GetX() - b.GetX()) * (a.GetX() - b.GetX()) + (a.GetY() - b.GetY()) * (a.GetY() - b.GetY()));
	cout << "Distance's constructor was called" << endl;

}
double Distance::GetDis()
{

	return dist;
}
Point::~Point()
{
	cout << "Point's destructor was called" << endl;
}
Distance::~Distance()
{
	cout << "Distance's destructor was called"<<endl;
}
int main()

{

	Point myp1(1, 1), myp2(4, 5);
	Distance myd(myp1, myp2);

	cout << endl;

	cout << "the distance is:" << myd.GetDis() << endl;

	return 0;

}